package com.cnap.multiclouldmgmt.vm.web;

import com.cnap.multiclouldmgmt.model.CommonResult;
import com.cnap.multiclouldmgmt.vm.service.VMScale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class VMScaleWeb {

    @Autowired
    VMScale vmScale;

    /**
     * 通知弹性伸缩组策略新增
     * @param id
     * @return
     * @throws InterruptedException
     */
    public CommonResult<String> addVmPolicy(String id) throws InterruptedException {
        CommonResult<String> result = vmScale.addScalePolicy(id);
        return result;
    }

    /**
     * 通知弹性伸缩组策略更新
     * @param id
     * @return
     * @throws InterruptedException
     */
    public CommonResult<String> updateVmPolicy( String id) throws InterruptedException {
        CommonResult<String> result = vmScale.updateScalePolicy(id);
        return result;
    }

    /**
     * 通知弹性伸缩组策略删除
     * @param id
     * @return
     * @throws InterruptedException
     */
    public CommonResult<String> deleteVmPolicy(String id) throws InterruptedException {
        CommonResult<String> result = vmScale.deleteScalePolicy(id);
        return result;
    }

}
